<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/mcStyle.css"/>
        <script type="text/javascript" src="javascript/calendarDateInput.js">
            /***********************************************
            * Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
            * Script featured on and available at http://www.dynamicdrive.com
            * Keep this notice intact for use.
            ***********************************************/
        </script>
        <script type="text/javascript">
            function checkForm(){
                var startDate = document.getElementById('startDate').getAttribute('value');
                var endDate = document.getElementById('endDate').getAttribute('value');
                
                if(endDate < startDate){
                    alert('Invalid date range.\n\nPlease ensure that Start Date is prior to End Date.');
                    return false;
                }
                else{
                    return true;
                }
            }
        </script>


        <title>McCanada Restaurants</title>
    </head>
    <body>
        <?php
            include('session.php');
            include('header.php');
        ?>

                <form method="POST" onSubmit="return checkForm()" action="process.php">
                    <table class="reporting">
                        <tr>
                            <td>Start Date: </td>
                            <td><script>DateInput('startDate', true, 'YYYY-MM-DD')</script>
                                   <!-- uncomment for testing
                                   <input type="button" onClick="alert(this.form.startDate.value)" value="Show date value passed">
                                   -->
                            </td>
                        </tr>
                        <tr>
                            <td>End Date: </td>
                            <td><script>DateInput('endDate', true, 'YYYY-MM-DD')</script>
                                 <!-- uncomment for testing
                                 <input type="button" onClick="alert(this.form.endDate.value)" value="Show date value passed">
                                 -->
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2"><input type="submit" value="Get Report"></td>
                        </tr>
                        
                    </table>
                </form>
                <br /><br />
        <?php
            include('footer.php');
        ?>
    </body>
</html>

